package com.wxit.data;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class FileRead {
    public static void main(String[] args) {
        String path = "C:\\Users\\17372\\Desktop\\yanjiu\\agent-titd-v1.1.13-debug\\log\\GNEWFLJXSZagent_2024-04-18.log";
        List<String> list = new ArrayList<>();
        try (BufferedReader reader = new BufferedReader(new FileReader(path))) {
            String line;
            while ((line = reader.readLine()) != null) {
                if (line.contains("order.InstrumentId")) {
                    line = line.substring(117,123);
                    list.add(line);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        ArrayList<String> newlist = new ArrayList<>(new HashSet<>(list));
        newlist.forEach(System.out::println);
    }
}
